﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MenuList.aspx.cs" Inherits="Myproject.Menu.MenuList" %>

<!DOCTYPE html>

<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="/menu/menuList.aspx" method="post">
        <div class="bjui-searchBar">
            <label>频道：</label>
            <select name="menu_menuList_tid" runat="server" id="menu_menuList_tid" data-toggle="selectpicker">
                <option value="">全部</option>
                <option value="1">后台</option>
                <option value="2">前台</option>
                <option value="3">平板</option>
            </select>
            <button type="submit" class="btn-green" data-icon="search">查询</button>
            <a class="btn btn-orange" href="javascript:;" data-toggle="reloadsearch" data-clear-query="true" data-icon="undo">刷新</a>
            <a class="btn btn-green" href="/menu/menuEdit.aspx" data-toggle="dialog" data-width="550" data-height="300" data-id="menu_menuEdit" data-icon="plus">新增根目录</a>
        </div>
    </form>
</div>
<div class="bjui-pageContent">
    <table class="table table-bordered table-hover table-striped table-top" data-selected-multi="true" style="text-align: center;">
        <thead>
            <tr>
                <th style="text-align: center;" rowspan="2"></th>
                <th style="text-align: center;" rowspan="2">类型</th>
                <th style="text-align: center;" colspan="2">根目录</th>
                <th style="text-align: center;" colspan="2">二级目录</th>
                <th style="text-align: center;" colspan="2">三级目录</th>
                <th style="text-align: center;" rowspan="2">状态</th>
                <th style="text-align: center;" rowspan="2">操作</th>
            </tr>
            <tr>
                <th style="text-align: center;">名称</th>
                <th style="text-align: center;">排序</th>
                <th style="text-align: center;">名称</th>
                <th style="text-align: center;">排序</th>
                <th style="text-align: center;">名称</th>
                <th style="text-align: center;">排序</th>
            </tr>
        </thead>
        <tbody>
            <%if (MessageTable != null && MessageTable.Rows.Count > 0)
              {
                  System.Data.DataRow[] rows1 = MessageTable.Select(" pid='0' ", "MenuTypeID,HtmlRank");
                  int i = 1;
                  foreach (System.Data.DataRow row in rows1)
                  {
                      string pid = row["MenuID"].ToString();
            %><tr>
                <th style="text-align: center;"><%= i %></th>
                <td style="text-align: center;"><%= row["MenuTypeName"] %></td>
                <td style="text-align: center;">
                    <%= row["MenuName"] %>
                </td>
                <td>
                    <a class="btn btn-green" href="/Menu/Menuajax.ashx?dos=rank&id=<%= row["MenuID"] %>&rank=1" data-toggle="doajax"><i class="fa fa-arrow-down"></i></a>
                    <span class="label label-info"><%= row["HtmlRank"] %></span>
                    <a class="btn btn-green" href="/Menu/Menuajax.ashx?dos=rank&id=<%= row["MenuID"] %>&rank=-1" data-toggle="doajax"><i class="fa fa-arrow-up"></i></a>

                </td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;"></td>
                <td>
                    <% if (bool.Parse(row["MenuFlag"].ToString()))
                       { %>
                    <a href="/Menu/Menuajax.ashx?dos=show&id=<%= row["MenuID"] %>&show=false" class="btn btn-green" data-toggle="doajax" data-icon="eye">已显示</a>
                    <%}
                       else
                       {
                    %>
                    <a href="/Menu/Menuajax.ashx?dos=show&id=<%= row["MenuID"] %>&show=true" data-toggle="doajax" class="btn btn-red" data-icon="eye-slash">已隐藏</a>
                    <%
                       } %>
                </td>
                <td>
                    
                    

            <%
                      System.Data.DataRow[] rows2 = MessageTable.Select(" pid='" + pid + "' ", "MenuTypeID,HtmlRank");
                      if (rows2.Count() == 0)
                      { 
                        %>
                            <a href="/Menu/Menuajax.ashx?dos=delete&id=<%= row["MenuID"] %>" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删除</a>
            <%
                      }
                      else
                      {
                        %>
                            <a href="/Menu/Menuajax.ashx?dos=delete&id=<%= row["MenuID"] %>" disabled class="btn btn-default" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删除</a>
            <%
                      }
                      %>
                            <a class="btn btn-green" href="/Menu/MenuEdit.aspx?id=<%= row["MenuID"] %>" data-toggle="dialog" data-width="550" data-height="300" data-id="menu_menuEdit" data-title="修改">修改</a>
                    <a class="btn btn-green" href="/Menu/MenuEdit.aspx?pid=<%= row["MenuID"] %>" data-toggle="dialog" data-width="550" data-height="300" data-id="menu_menuEdit" data-title="新增子目录">新增子目录</a>
                </td>
            </tr>
            <%
                      i++;
                      
                       foreach (System.Data.DataRow row2 in rows2)
                       {
                           string pid2 = row2["MenuID"].ToString();
            %><tr>
                <th style="text-align: center;"><%= i %></th>
                <td style="text-align: center;"><%= row2["MenuTypeName"] %></td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;">
                    <%= row2["MenuName"] %>
                </td>
                <td>
                    <a class="btn btn-green" href="/Menu/Menuajax.ashx?dos=rank&id=<%= row2["MenuID"] %>&rank=1" data-toggle="doajax"><i class="fa fa-arrow-down"></i></a>
                    <span class="label label-info"><%= row2["HtmlRank"] %></span>
                    <a class="btn btn-green" href="/Menu/Menuajax.ashx?dos=rank&id=<%= row2["MenuID"] %>&rank=-1" data-toggle="doajax"><i class="fa fa-arrow-up"></i></a>

                </td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;"></td>
                <td>
                    <% if (bool.Parse(row2["MenuFlag"].ToString()))
                       { %>
                    <a href="/Menu/Menuajax.ashx?dos=show&id=<%= row2["MenuID"] %>&show=false" class="btn btn-green" data-toggle="doajax" data-icon="eye">已显示</a>
                    <%}
                       else
                       {
                    %>
                    <a href="/Menu/Menuajax.ashx?dos=show&id=<%= row2["MenuID"] %>&show=true" data-toggle="doajax" class="btn btn-red" data-icon="eye-slash">已隐藏</a>
                    <%
                       } %>
                </td>
                <td>

            <%
                       System.Data.DataRow[] rows3 = MessageTable.Select(" pid='" + pid2 + "' ", "MenuTypeID,HtmlRank");
                       if (rows3.Count() == 0)
                      { 
                        %>
                            <a href="/Menu/Menuajax.ashx?dos=delete&id=<%= row2["MenuID"] %>" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删除</a>
            <%
                      }
                      else
                      {
                        %>
                            <a href="/Menu/Menuajax.ashx?dos=delete&id=<%= row2["MenuID"] %>" disabled class="btn btn-default" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删除</a>
            <%
                      }
                      %>
                            <a class="btn btn-green" href="/Menu/MenuEdit.aspx?id=<%= row2["MenuID"] %>" data-toggle="dialog" data-width="550" data-height="300" data-id="menu_menuEdit" data-title="修改">修改</a>
                    <a class="btn btn-green" href="/Menu/MenuEdit.aspx?pid=<%= row2["MenuID"] %>" data-toggle="dialog" data-width="550" data-height="300" data-id="menu_menuEdit" data-title="新增子目录">新增子目录</a>
                </td>
            </tr>
            <%
                           i++;
                       
                       
                       foreach (System.Data.DataRow row3 in rows3)
                       {
                           string pid3 = row3["MenuID"].ToString();
            %><tr>
                <th style="text-align: center;"><%= i %></th>
                <td style="text-align: center;"><%= row3["MenuTypeName"] %></td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;"></td>
                <td style="text-align: center;">
                    <%= row3["MenuName"] %>
                </td>
                <td>
                    <a class="btn btn-green" href="/Menu/Menuajax.ashx?dos=rank&id=<%= row3["MenuID"] %>&rank=1" data-toggle="doajax"><i class="fa fa-arrow-down"></i></a>
                    <span class="label label-info"><%= row3["HtmlRank"] %></span>
                    <a class="btn btn-green" href="/Menu/Menuajax.ashx?dos=rank&id=<%= row3["MenuID"] %>&rank=-1" data-toggle="doajax"><i class="fa fa-arrow-up"></i></a>
                </td>
                <td>
                    <% if (bool.Parse(row3["MenuFlag"].ToString()))
                       { %>
                    <a href="/Menu/Menuajax.ashx?dos=show&id=<%= row3["MenuID"] %>&show=false" class="btn btn-green" data-toggle="doajax" data-icon="eye">已显示</a>
                    <%}
                       else
                       {
                    %>
                    <a href="/Menu/Menuajax.ashx?dos=show&id=<%= row3["MenuID"] %>&show=true" data-toggle="doajax" class="btn btn-red" data-icon="eye-slash">已隐藏</a>
                    <%
                       } %>
                </td>
                <td>
                    <a href="/Menu/Menuajax.ashx?dos=delete&id=<%= row3["MenuID"] %>" class="btn btn-red" data-toggle="doajax" data-confirm-msg="确定要删除该行信息吗？">删除</a>
                    <a class="btn btn-green" href="/Menu/MenuEdit.aspx?id=<%= row3["MenuID"] %>" data-toggle="dialog" data-width="550" data-height="300" data-id="menu_menuEdit" data-title="修改">修改</a>
                    <a class="btn btn-default" href="/Menu/MenuEdit.aspx?pid=<%= row3["MenuID"] %>" disabled data-toggle="dialog" data-width="550" data-height="300" data-id="menu_menuEdit" data-title="新增子目录">新增子目录</a>
                </td>
            </tr>

            <%
                           i++;
                       }
                       }
                  }
              }%>
        </tbody>
    </table>

</div>
<div class="bjui-pageFooter">
</div>
